#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2022/1/12 15:15
# @Author  : ldh

from time import sleep

from basic.UIParent import UIParent
from basic.utils.asserts import asserts
from commen.page.agx.AGX_oclifePage import AGX_oclifePage
from commen.page.agx.AGXIndexPage import AGXIndexPage
from test.cases.agx.AGXLogin import AGXLogin


class AGX_oclife(UIParent):

    @classmethod
    def test_openOclife(cls):
        '''一码八桂首页校验'''

        # 判断是否登录
        AGXLogin.test_agxLoginByPwd()
        #打开首页
        AGXIndexPage.openHomePage()
        AGX_oclifePage.openOclife()
        sleep(3)
        #页面校验
        status=AGX_oclifePage.ifoclife()
        asserts.equal(status,True,"一码八桂页面校验")
        #拉码、场景展示校验
        AGX_oclifePage.qrcode()
        AGX_oclifePage.channel()


    def test_moreChannel(self):
        '''一码八桂更多场景校验'''

        # 判断是否登录
        AGXLogin.test_agxLoginByPwd()
        #打开一码八桂首页
        AGXIndexPage.openHomePage()
        AGX_oclifePage.openOclife()
        sleep(3)
        AGX_oclifePage.moreChannel()
        channellist=AGX_oclifePage.getChannelName()
        asserts.true(len(channellist)>0,"更多场景列表校验")


    def test_payChanel(self):
        '''一码八桂支付方式校验'''
        # 判断是否登录
        AGXLogin.test_agxLoginByPwd()
        #打开一码八桂首页
        AGXIndexPage.openHomePage()
        AGX_oclifePage.openOclife()
        sleep(3)
        AGX_oclifePage.openPayChannel()
        channel=AGX_oclifePage.getPayChannel()
        asserts.true(len(channel)>0,"支付方式校验")









